const mongoose = require('mongoose')
const supplier = new mongoose.Schema({
    c_name: {
        type: String,
        required: true,
        unique: true, // 特殊索引，唯一索引
    },
    c_code: {
        type: String,
        required: true,
    },
    c_email: {
        type: String,
        required: true,
    },
    c_telphone: {
        type: String,
        required: true,
    },
    c_password: {
        type: String,
        select: false, // 默认情况下，查询用户时不会查询该字段
    },
    c_address: {
        type: String,
    },
    c_type: {
        type: String,
    },
    c_state: {
        type: String
    },
    c_time: {
        type: String
    },
    businessLicense: {
        type: String,
    },
    accountOpeningPermit: {
        type: String,
    },
    relevantQualification: {
        type: String,
    },
    taxpayerCertificate: {
        type: String,
    },
    corporateIdentityCard: {
        type: String,
    },
    financialAuditReport: {
        type: String,
    },
    paymentDocument: {
        type: String,
    },
    contractScan: {
        type: String,
    },
    validMailingAddress: {
        type: String,
    }
})
module.exports = mongoose.model('Supplier', supplier)